﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace GZNest.Entity.Spin.Biz
{
    public class ProductionOrder
    {
        [Key]
        public int OrderId { get; set; }

        [StringLength(50, MinimumLength = 1, ErrorMessage = "Description cannot be longer than 50 characters.")]
        public string Description { get; set; }

        [Range(1, 999999)]
        public decimal OrderMount { get; set; }

        [DisplayFormat(NullDisplayText = "0.00")]
        public decimal CompletedLenght { get; set; }

        [DisplayFormat(NullDisplayText = "0.00")]
        public decimal DailyProduction { get; set; }

        public LengthUnit Unit { get; set; }

        public DateTime? CreatedDateTime { get; set; }

        public DateTime? LastModifiedDatetime { get; set; }

        public OrderStatus Status { get; set; }

        public virtual ICollection<ProductionOrderLine> OrderLines { get; set; }
    }

    public enum OrderStatus
    {
        Default = 0
    }

    public enum LengthUnit
    {
        Metre = 0,
        KiloMetres
    }
}
